package com.neizhijiekou;

import java.util.function.Consumer;

public class ConsumerTest {

    // 没有返回值
    // 传入一个参数   使用这个参数。。。
    public void jianfei(Integer weight, Consumer<Integer> consumer){
        consumer.accept(weight);
    }


    public void buyClothes(Integer weight,Consumer<Integer> consumer,Consumer<Integer> consumer2){
        //consumer.accept(weight);
        consumer.andThen(consumer2).accept(weight);
    }





    public static void main(String[] args) {
        ConsumerTest co = new ConsumerTest();
       // co.jianfei(50,  integer -> System.out.println("我的目标体重是 = " + integer));
        co.buyClothes(50, integer -> System.out.println("减肥之后的体重是: " + integer), integer -> System.out.println("目前的体重是: " + integer+"可以"));
    }
}
